package com.ideaaedi.zoo.example.springboot.flowable.sharding.entity.dto;

import com.ideaaedi.zoo.example.springboot.flowable.sharding.entity.tuple.StrObjVar;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.Set;

/**
 * (non-javadoc)
 *
 * @author <font size = "20" color = "#3CAA3C"><a href="https://gitee.com/JustryDeng">JustryDeng</a></font> <img
 * src="https://gitee.com/JustryDeng/shared-files/raw/master/JustryDeng/avatar.jpg" />
 * @since 1.0.0
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class ShardingTaskListQueryDTO extends ShardingBaseQueryDTO {
    
    /**
     * 租户值
     */
    @Nonnull
    private String tenant;
    
    /**
     * 流程实例id
     */
    @Nullable
    private String processInstanceId;
    
    /**
     * 流程实例id集合
     */
    @Nullable
    private Set<String> processInstanceIds;
    
    /**
     * 任务id集合
     */
    @Nullable
    private Set<String> taskIds;
    
    /**
     * 任务是否已完成（true-任务已完成；false-任务未完成）
     */
    @Nullable
    private Boolean ifFinished;
    
    /**
     * 根据任务变量（局部变量）值进行精确查询
     */
    @Nullable
    private Collection<StrObjVar> taskVariableValueEqualsColl;
    
    /**
     * 根据流程变量值进行精确查询
     */
    @Nullable
    private Collection<StrObjVar> processVariableValueEqualsColl;
    
    /** 是否顺带查询出本地任务变量 */
    @Nullable
    private Boolean queryTaskLocalVariables;
    
    /** 是否顺带查询出流程变量 */
    @Nullable
    private Boolean queryProcessVariables;
    
    /**
     * 是否根据任务开始时间排序
     * <ul>
     *     <li>true - 升序</li>
     *     <li>false - 降序</li>
     * </ul>
     */
    @Nullable
    private Boolean orderByTaskStartTime;
    
    /**
     * 是否根据任务结束时间排序
     * <ul>
     *     <li>true - 升序</li>
     *     <li>false - 降序</li>
     * </ul>
     */
    @Nullable
    private Boolean orderByTaskEndTime;
}
